<h1><?php echo $title; ?></h1>
<div class="noprint">
<?php if (isset($notice) || $notice = $this->session->flashdata('notification')):?>
<p class="notice"><?php echo $notice;?></p>
<?php endif;?>

<?php if (count($rows) == 0) : ?>
<p class="notice"><?php echo __("Nessuno risultato", $module);?></p>
<?php endif; ?>


<form method='post' action='<?php echo site_url('adozioni/contabilita/rimesse/show') ?>'>

<fieldset style=" margin: auto;">
<legend>Scelta</legend>



<label for="anno"><?php echo __("Anno", $module) ?></label>
<select name="anno">
<?php foreach($anni as $a): ?>
<option value="<?php echo $a['anno'] ?>" <?php if($a['anno'] == $anno) echo " selected "; ?>><?php echo $a['anno']; ?></option>
<?php endforeach; ?>
</select>

<label for="trimestre" style="background-color: #EEEEEE;">  <?php echo __("Trimestre:", $module) ?>
<select name="trimestre" id="trimestre">
<?php for($i = 1; $i <= 4; $i++): ?>
<option value="<?php echo $i; ?>" <?php if($i == $trimestre) echo "selected" ?>><?php echo sprintf(__("%so trimestre", $module), $i) ?></option>
<?php endfor; ?>
</select>
</label>


<label for="excel">Excel <input type="checkbox" name="excel" value="1" /></label> 
<input type="submit" name="go" value="  Visualizza  "/>

</fieldset>

</form>
</div>

	<table class='list'>
	<tr>
		<th><?php echo __("Rimessa", $module) ?></th>
		<th><?php echo __("Conto/Bonifico", $module) ?></th>
		<th><?php echo __("Lordo", $module) ?></th>
		<th><?php echo __("Trattenute", $module) ?></th>
		<th><?php echo __("Netto", $module) ?></th>
	</tr>
<?php if($rows): ?>
<?php
		$totale = 0;
		$lordo = 0;
		$trattenute = 0;
		$i = 0;

?>		
<?php foreach($rows as $r): ?>
<?php
		$totale += $r['totale'];
		$lordo += $r['lordo'];
		$trattenute += $r['trattenute'];
		# Colore alternato righe
		$class = (($i % 2) == 0) ? 'item1' : 'item2';
?>
	<tr>
		<td><?php echo $r['nome'] ?></td>
		<td><?php echo $r['conto'] ?></td>
		<td style="text-align: right"><?php echo format_euro($r['lordo']) ?></td>
		<td style="text-align: right"><?php echo format_euro($r['trattenute']) ?></td>
		<td style="text-align: right"><?php echo format_euro($r['totale']) ?></td>
		
	</tr>
<?php endforeach; ?>
	<tr class='total'>
		<td style="text-align: right" colspan=2 class="total"><?php echo __("Totale", $module) ?></td>
		
		<td style="text-align: right" class="total"><?php echo format_euro($lordo) ?></td>
		<td style="text-align: right" class="total"><?php echo format_euro($trattenute) ?></td>
		<td style="text-align: right" class="total"><?php echo format_euro($totale) ?></td>
	</tr>
<?php endif; ?>
</table>
